﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HurSimLib
{
    public abstract class HurProcessBase 
    {
        /// <summary>
        /// The list of the objects entering the process
        /// </summary>
        private List<HurObject> m_entryqueue;

        public List<HurObject> Entryqueue
        {
            get { return m_entryqueue; }
            set { m_entryqueue = value; }
        }
        /// <summary>
        /// The generator for the process. It will generate service time periods
        /// according to the random number distribution selected for this process.
        /// </summary>
        private Troschuetz.Random.Distribution m_processtimedistribution;

        public Troschuetz.Random.Distribution Processtimedistribution
        {
            get { return m_processtimedistribution; }
            set { m_processtimedistribution = value; }
        }
        /// <summary>
        /// The process which wil receive the objects after this one.
        /// </summary>
        private HurProcessBase m_nextprocess;

        public HurProcessBase Nextprocess
        {
            get { return m_nextprocess; }
            set { m_nextprocess = value; }
        }

        public HurProcessBase()
        {
            m_nextprocess = null; m_processtimedistribution = null;
            m_entryqueue = new List<HurObject>();
        }

        /// <summary>
        /// This property gets'sets the underlying random generation distribution
        /// </summary>
        public Troschuetz.Random.Distribution GeneratorDistribution
        {
            get { return m_processtimedistribution; }
            set { m_processtimedistribution = value; }
        }

        /// <summary>
        /// This function accepts an object to the process queue (if any)
        /// after the object approves the entry. As a result, the object's process
        /// entry, process start and process end times are calculated.
        /// </summary>
        /// <param name="newobject"></param>
        public abstract void EnterObject(HurObject newobject);
    }
}
